<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <body>
        手机号码： <input type="number"> <button>发送</button>
    </body>
    <script type="text/javascript">
        var btn = document.querySelector('button');
        var t = 5;
        btn.addEventListener('click', function() {
            this.disabled = true;
            var timer = setInterval(function() {
                if (t == 0) {
                    clearInterval(timer);
                    btn.disabled = false;
                    btn.innerHTML = '发送';
                    t = 5;
                } else {
                    btn.innerHTML = '还剩下' + t + '秒';
                    t--;
                }
            }, 1000);
        });
    </script>
</html>
